<template>
  <CardItem
    title="业户人员待审核"
    :num="num"
    :icon="icon"
    @goMore="goMore"
  />
</template>

<script>
import { message } from "ant-design-vue";
import {
  defineComponent,
  reactive,
  ref,
  computed,
  watch,
  toRaw,
  toRefs,
} from "vue";
import utils from "@/common/utils/utils";
import request from "@/common/utils/request";
import CardItem from "@/views/home/components/CardItem.vue";
export default defineComponent({
  name: "BussinessApproveCard",
  components: { CardItem },
  props: {

  },
  setup(props, context) {

    const state = reactive({
      num: 0,
      icon: utils.staticPath + `images/workbench/owner.jpg`,
    });

    const getData = () => {
      request.get("/village", `/workbench/user_count`).then((res) => {
        state.num = res?.count?.approval_count;
      });
    };

    getData();

    const goMore = () => {
      window.microApp.forceDispatch({
        type: "SetMicroPages",
        microInfo: {
          microId: `org_workbench_ownerList`,
          app: 'org',
          name: `业户人员列表`,
          url: `/village/ownerUser?status=0`,
        }
      })
    };


    return {
      ...toRefs(state),
      goMore,
    };
  },
});


</script>

<style lang="less" scoped>

</style>
